<nz-card nzTitle="活动信息">
  <nz-descriptions
    nzBordered
    [nzColumn]="{ xxl: 4, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }"
  >
    <nz-descriptions-item nzTitle="活动名称">{{ activityInfoData.name || '-' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="备注">{{ activityInfoData.note || '-' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="活动总额">
      <b>{{ activityInfoData.total || '0' }}</b> 个爱豆
    </nz-descriptions-item>
    <nz-descriptions-item nzTitle="赠送比例">单台机器验机价 <b>{{ activityInfoData.proportion || '0' }}</b> %</nz-descriptions-item>

    
    <nz-descriptions-item nzTitle="最高赠送"><b>{{ activityInfoData.highest || '-' }}</b> 个爱豆</nz-descriptions-item>
    <nz-descriptions-item nzTitle="适用成色">
      {{ setDictText(conditionOptionsC, 'id', activityInfoData.colourId) }}
    </nz-descriptions-item>
    <nz-descriptions-item nzTitle="活动状态">
      <span [ngStyle]="{'color': activityInfoData.state | loveRecoveryActstatus: 'color'}">
        {{ activityInfoData.state | loveRecoveryActstatus: 'label' }}
      </span>
    </nz-descriptions-item>
    <nz-descriptions-item nzTitle="活动时间">
      {{ activityInfoData.beginTime || '----' }} ~ {{ activityInfoData.endTime || '----' }}
    </nz-descriptions-item>
    
    <nz-descriptions-item nzTitle="适用机型">{{ activityInfoData.modelName || '-' }}</nz-descriptions-item>
  </nz-descriptions>
</nz-card>

<nz-card nzTitle="活动统计" class="m-t-4">
  <nz-descriptions
    nzBordered
    [nzColumn]="{ xxl: 4, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }"
  >
    <nz-descriptions-item nzTitle="下单数量">{{ activityCensusData.selectCount || '0' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="成交订单数">{{ activityCensusData.dealCount || '0' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="待到账爱豆">{{ activityCensusData.notReceipt || '0' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="已到账爱豆">{{ activityCensusData.receipt || '0' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="已冻结爱豆">{{ activityCensusData.frozen || '0' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="剩余爱豆">{{ activityCensusData.surplus || '0' }} 个</nz-descriptions-item>
  </nz-descriptions>
</nz-card>

<nz-card nzTitle="回收送爱豆记录" class="m-t-4">
  <!-- S search -->
  <app-search-bar
    [submitLoading]="recordTableParams.loading"
    [searchOptions]="recordSearchOptions"
    labelFlex="80px"
    (onSearch)="queryResetRecordData($event)"
    (onReset)="queryResetRecordData($event)"
  ></app-search-bar>
  <!-- E search -->

  <div class="pagination-wrap-position p-t-10">
    <nz-table
      #recordTable
      nzSize="small"
      nzShowSizeChanger
      nzShowQuickJumper
      nzOuterBordered
      [nzFrontPagination]="false"
      [nzLoadingDelay]="100"
      [nzLoading]="recordTableParams.loading"
      [nzData]="recordTableParams.tableData"
      [nzPageSizeOptions]="[5, 10, 20, 50, 100]"
      [nzTotal]="recordTableParams.total"
      [nzPageIndex]="recordTableParams.page"
      [nzPageSize]="recordTableParams.pageSize"
      [nzShowTotal]="totalTemplate"
      (nzPageIndexChange)="onPageIndexChange($event)"
      (nzPageSizeChange)="onPageSizeChange($event)"
    >
      <thead>
        <tr>
          <th nzAlign="center">订单编号</th>
          <th nzAlign="center">用户身份</th>
          <th nzAlign="center">订单状态</th>
          <th nzAlign="center">赠送爱豆</th>
          <th nzAlign="center">赠送状态</th>
          <th nzAlign="center">赠送时间</th>
          <th nzAlign="center">下单时间</th>
          <th nzAlign="center">成交时间</th>
          <th nzAlign="center">操作</th>
        </tr>
      </thead>

      <tbody>
        <tr *ngFor="let data of recordTable.data; let index = index;">
          <!-- 订单编号 -->
          <td nzAlign="center">{{ data.okey || '-' }}</td>
          <!-- 用户身份 -->
          <td nzAlign="center">
            <span>
              {{ data.userId ? '爱思用户' : '游客' }}
            </span>
          </td>
          <!-- 订单状态 -->
          <td nzAlign="center">
            <span [ngStyle]="{'color': data.orderState | orderState: 'color'}">
              {{ data.orderState | orderState: 'text' }}
            </span>
          </td>
          <!-- 赠送爱豆 -->
          <td nzAlign="center">
            <ng-container *ngIf="data.isPush == 1; else elseZsadTemplate">
              {{ data.idol || '-' }}
            </ng-container>
            <ng-template #elseZsadTemplate>-</ng-template>
          </td>
          <!-- 赠送状态 注：根据推送状态判断，未推送时赠送爱豆、状态显示‘-’ -->
          <td nzAlign="center">
            <ng-container *ngIf="data.isPush == 1; else elseZsTemplate">
              <!-- 游客显示已冻结、其他正常显示 -->
              <ng-container *ngIf="!data.userId; else elseTemplate">
                <span style="color: #F56C6C;">
                  {{ data.status === 5 ? '已失效' : '已冻结' }}
                </span>
              </ng-container>

              <ng-template #elseTemplate>
                <span [ngStyle]="{'color': data.status | loveRecoveryGivestatus: 'color'}">
                  {{ data.status | loveRecoveryGivestatus: 'text' }}
                </span>
              </ng-template>
            </ng-container>

            <ng-template #elseZsTemplate>
              -
            </ng-template>
          </td>
          <!-- 赠送时间 -->
          <td nzAlign="center">{{ data.givingTime || '-' }}</td>
          <!-- 下单时间 -->
          <td nzAlign="center">{{ data.createTime || '-' }}</td>
          <!-- 成交时间 -->
          <td nzAlign="center">{{ data.dealTime || '-' }}</td>
          <!-- 操作 -->
          <td nzAlign="center">
            <a
              nz-button
              nzType="link"
              target="_blank"
              routerLink="/aisi-recyc/loveOrderDetails"
              [queryParams]="{id: data.orderId}"
            >查看订单</a>
          </td>
        </tr>
      </tbody>
    </nz-table>

    <!-- 分页template -->
    <ng-template #totalTemplate let-total>共有 {{ total }} 条</ng-template>
  </div>
</nz-card>